package com.yanchi.controller;


import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.cloud.client.ServiceInstance;
import org.springframework.cloud.client.discovery.DiscoveryClient;
import org.springframework.cloud.client.loadbalancer.LoadBalanced;
import org.springframework.cloud.client.loadbalancer.LoadBalancerClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.client.RestTemplate;


/**
 * @author yanchi
 */
@RestController
public class UserController {

    @Autowired
    private RestTemplate restTemplate;


    @GetMapping("user")
    public String userDemo() {


        String userResult = restTemplate.getForObject( "http://ORDERS/order", String.class);

        return "user demo ok !!!" + userResult;
    }

}
